/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.dc.task;

import java.util.TimerTask;

/**
 *
 * @author Administrator
 */
public abstract class BaseTask extends TimerTask {

    public abstract BaseTask start();

    public abstract BaseTask doTask();

    public abstract BaseTask stop();
    public abstract BaseTask cancelTask();

    @Override
    public void run() {
        start().doTask().stop();
    }

    @Override
    public boolean cancel() {
            cancelTask();
        return super.cancel(); //To change body of generated methods, choose Tools | Templates.
    
        
    }
    

}
